package com.zhifei.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhifei.system.domain.EmployeeGrowRecordEntity;
import com.zhifei.system.domain.vo.EmployeeGrowRecordVo;
import com.zhifei.system.mapper.EmployeeGrowRecordMapper;
import com.zhifei.system.service.EmployeeGrowRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class EmployeeGrowRecordServiceImpl extends ServiceImpl<EmployeeGrowRecordMapper, EmployeeGrowRecordEntity> implements EmployeeGrowRecordService {

    @Autowired
    private EmployeeGrowRecordMapper employeeGrowRecordMapper;

    @Override
    public List<EmployeeGrowRecordVo> list(Map<String, Object> params) {
        String jobNum = (String) params.get("jobNum");
        List<EmployeeGrowRecordVo> list = employeeGrowRecordMapper.list(jobNum);
        return list;
    }

    @Override
    public void add(Integer growType, String jobNum, String content) {
        EmployeeGrowRecordEntity employeeGrowRecordEntity = new EmployeeGrowRecordEntity();
        employeeGrowRecordEntity.setGrowType(growType);
        employeeGrowRecordEntity.setJobNum(jobNum);
        employeeGrowRecordEntity.setContent(content);
        this.save(employeeGrowRecordEntity);
    }
}
